﻿@{
    ViewBag.Title = "ChangeLoginName";
}
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>修改登录名</title>
    <script type="text/javascript">
        $(function () {
            com.ajax({
                url: '/BD/User/getCurrentName',
                data: {},
                success: function (data) {
                    $('#txtPassword').val(data.msg);
                }
            });
        });
    </script>
</head>
<body>
    <form id="form1">
        <div class="dialog-content">
            <ul>
                <li>
                    登录名：<input id="txtPassword" name="pwd" class="easyui-validatebox" data-options="required:true" style="width: 150px" />
                </li>
            </ul>
        </div>
        <div class="dialog-bottom">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="changePwd.Confirm()">确定</a>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="changePwd.Cancel()">取消</a>
        </div>
    </form>
    <script type="text/javascript">
        var changePwd = {};
        changePwd.Cancel = function () {
            $("#divChangePwd").dialog('close');
        }
        changePwd.Confirm = function () {
            if ($("#form1").form("validate")) {
                com.ajax({
                    type: "POST",
                    url: "/BD/User/ChangeLoginN",
                    data: { loginname: $('#txtPassword').val() },
                    success: function (data) {
                        if (data.state == "error") {
                            com.message("information", data.msg);
                        }
                        else {
                            com.message("information", data.msg);
                            $("#divChangePwd").dialog('close');
                        }
                    }
                });
            }
        }
    </script>
</body>
</html>
